//
//  MyOrderViewController.m
//  beautyLamp
//
//  Created by Tam Kwok To Michael on 2017/8/25.
//  Copyright © 2017年 Tam Kwok To Michael. All rights reserved.
//

#import "MyOrderViewController.h"
#import "HorizontalScrollerCollectionView.h"
#import <Masonry.h>
#import "LatestOrderViewController.h"

@interface MyOrderViewController ()

@property (nonatomic, strong) HorizontalScrollerCollectionView *collectionView;

@end

@implementation MyOrderViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}

- (void)setupUI {
    self.title = @"我的订单";
    [self.navigationController.navigationBar setBarTintColor:[UIColor whiteColor]];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    self.collectionView = [HorizontalScrollerCollectionView horizantalScrollerCollection];
    self.collectionView.frame = [UIScreen mainScreen].bounds;
    [self.view addSubview:self.collectionView];
    __weak typeof (self) weakSelf = self;
    [_collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.right.bottom.equalTo(weakSelf.view);
    }];
    LatestOrderViewController *c1 = [[LatestOrderViewController alloc] init];
    c1.state = 1;
    
    LatestOrderViewController *c2 = [[LatestOrderViewController alloc] init];
    c2.state = 2;
    
    
    LatestOrderViewController *c3 = [[LatestOrderViewController alloc] init];
    c3.state = 4;
    
    
    LatestOrderViewController *c4 = [[LatestOrderViewController alloc] init];
    c4.state = -1;
    
    [self addChildViewController:c1];
    [self addChildViewController:c2];
    [self addChildViewController:c3];
    [self addChildViewController:c4];
    self.collectionView.controllers = @[c1,c2,c3,c4];
    self.collectionView.titles = @[@"最新", @"待付款" ,@"已完成",@"已拒绝"];
    
}

@end
